home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / turbo_tk.arc / DIRTTT.PAS < prev    next >
Pascal/Delphi Source File  |  1988-02-01  |  20KB  |  613 lines

  1. {\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}
  2. {         TechnoJocks Turbo Toolkit v4.00            Released: Feb 1, 1988    }
  3. {                                                                             }
  4. {         Module: DirTTT    --   a directory listing unit a la Sidekick       }
  5. {                                                                             }
  6. {                       Copyright R. D. Ainsbury (c) 1986                     }
  7. {\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}
  8.  
  9. Unit DirTTT;
  10.  
  11. Interface
  12.  
  13. Uses CRT, FastTTT, DOS, KeyTTT, WinTTT;
  14.  
  15. Function Display_Directory(var PathName:string; FileMask:string): string;
  16. Procedure Default_Settings;
  17.  
  18. Type
  19.    DirDisplay = record
  20.                      TopX    : byte;
  21.                      TopY    : Byte;
  22.                      Cols    : byte;
  23.                      Rows    : byte;
  24.                      DateTime: boolean;
  25.                      CDir    : boolean;
  26.                      Attrib  : byte;
  27.                      BoxType : byte;
  28.                      BoxCol  : byte;
  29.                      BacCol  : byte;
  30.                      NorCol  : byte;
  31.                      DirCol  : byte;
  32.                      HiFCol  : byte;
  33.                      HiBCol  : byte;
  34.                      AllowEsc : boolean;
  35.                  end;
  36.  
  37. Var
  38.    D : DirDisplay;
  39.  
  40. Implementation
  41.  
  42. Procedure Default_Settings;
  43. begin
  44.     With  D  do
  45.     begin
  46.         TopX    := 15;
  47.         TopY    := 5;
  48.         Cols    := 4;
  49.         Rows    := 15;
  50.         DateTime:= true;
  51.         CDir    := true;
  52.         AllowEsc := true;
  53.         Attrib := AnyFile;
  54.         BoxType := 1;      {single lined box}
  55.         If BaseOfScreen = $b000 then
  56.         begin
  57.             BoxCol := white;
  58.             BacCol := black;
  59.             NorCol := white;
  60.             DirCol := lightgray;
  61.             HiFcol := black;
  62.             HiBcol := lightgray;
  63.         end
  64.         else
  65.         begin
  66.             BoxCol := red;
  67.             BacCol := lightgray;
  68.             NorCol := black;
  69.             DirCol := yellow;
  70.             HiFcol := white;
  71.             HiBcol := blue;
  72.         end;
  73.     end; {with}
  74. end;
  75.  
  76. Function Display_Directory(var PathName:string; FileMask:string): string;
  77.  
  78. Const
  79. Mcols = 6;       {lower these settings to reduce the amount of}
  80. Mrows = 23;      {memory used - if necessary}
  81. Lchar = #16;
  82. Rchar = #17;
  83. Null  = #0;
  84. HomeKey = #199;   EndKey = #207;   Esc = #027;   Enter = #13;
  85. Cursup  = #200;   CursDown = #208; CursLeft = #203; CursRight = #205;
  86. PgDn    = #209;   PgUp     = #201;
  87.  
  88. Type
  89. Filerecord = record
  90.                Name : string[12];
  91.                Size : LongInt;
  92.                Time : LongInt;
  93.                Attr : byte;
  94.              end;
  95. DirBox =  array[1..Mcols,1..Mrows] of ^Filerecord;
  96. DirectoryData = record
  97.                    CurrEntry : byte; { the number of the highlighted file }
  98.                    TotFiles  : byte; { the total number of files in cur. box }
  99.                    CurrPage  : integer; { current directory page number}
  100.                    FileData  : DirBox;  { name and attrib info }
  101.                    MoreFiles : boolean; { true if not end of directory }
  102.                 end;
  103. Var
  104. Dbox : DirectoryData;        {array of files and attributes}
  105. X2 : byte;                   {right hand box coord}
  106. I,J : integer;               {misc}
  107.  
  108. {\\\\\\\\\\\\\\\\\\\\\\    Miscellaneous procedures   \\\\\\\\\\\\\\\\\\\\\}
  109.  
  110. FUNCTION Copies (ch:char; n:integer) : String;
  111. begin
  112. InLine (   $16 /$07 /$8B /$4E /$04 /$88 /$4E /$08 /$8B
  113.        /$46 /$06 /$8D /$7E /$09 /$FC /$F3 /$AA );
  114. end;  { Copies }
  115.  
  116.  
  117. Function Left(S : string;Size : byte; Pad : char):string;
  118. var temp : string;
  119. begin
  120.     Fillchar(Temp[1],Size,Pad);
  121.     Temp[0] := chr(Size);
  122.     If Length(S) <= Size then
  123.        Move(S[1],Temp[1],length(S))
  124.     else
  125.        Move(S[1],Temp[1],size);
  126.     Left := Temp;
  127. end;
  128.  
  129. Function Center(S : string;Size : byte; Pad : char):string;
  130. var
  131.   temp : string;
  132.   L : byte;
  133. begin
  134.     Fillchar(Temp[1],Size,Pad);
  135.     Temp[0] := chr(Size);
  136.     L := length(S);
  137.     If L <= Size then
  138.        Move(S[1],Temp[((Size - L) div 2) + 1],L)
  139.     else
  140.        Move(S[((L - Size) div 2) + 1],Temp[1],Size);
  141.     Center := temp;
  142. end; {center}
  143.  
  144. Function Int_to_Str(I : Longint):string;
  145. var S : string[11];
  146. begin
  147.     Str(I,S);
  148.     Int_to_Str := S;
  149. end;
  150.  
  151. Function CalcCol(Entry : byte) : byte;
  152. { returns the display column of the file}
  153. begin
  154.     CalcCol := Succ(Pred(Entry) MOD D.cols);
  155. end;
  156.  
  157. Function CalcRow(Entry : byte) : byte;
  158. { returns the display row of the file}
  159. begin
  160.     CalcRow := Pred(Entry + D.cols) DIV D.cols;
  161. end;
  162.  
  163. Function Subdirectory(Attrib:byte): boolean;
  164. begin
  165.     Subdirectory := ((Attrib and 16) = 16);
  166. end;
  167.  
  168. Function ValidPathName:Boolean;
  169. begin
  170.     If PathName[Length(PathName)] <> '\' then
  171.        PathName := PathName + '\';
  172.     {$I-}
  173.     If (length(PathName) = 3) and (PathName[2] = ':') then
  174.        Chdir(PathName)
  175.     else
  176.        ChDir(copy(Pathname,1,length(Pathname) - 1));
  177.     {$I+}
  178.     ValidPathName := (IoResult = 0);
  179. end;  {ValidPathName}
  180.  
  181. Function FileDetails(F:FileRecord):string;
  182. var
  183.   DT : DateTime;
  184.   Str: string;
  185. begin
  186.     UnPackTime(F.Time,DT);
  187.     Str := Int_to_Str(F.Size)+'  '
  188.            +Int_to_Str(DT.Month)+'-'+Int_to_Str(DT.Day)+'-'
  189.            +copy(Int_to_Str(DT.Year),3,2)
  190.            +'  '+Int_To_Str(DT.Hour)+':'+Int_to_Str(DT.Min);
  191.     FileDetails := Str;
  192. end;
  193.  
  194. Function ExtractPrevDir(Path : string): string;
  195. begin
  196.  Repeat
  197.   Delete(Path,length(Path),1);
  198.  Until ( copy(Path,length(Path),1) = '\') or (length(Path) = 0);
  199.  Delete(Path,length(Path),1);
  200.  If length(Path) > 2 then
  201.   ExtractPrevDir := Path
  202.  else
  203.   ExtractPrevDir := Path + '\';
  204. end; {ExtractPrevDir}
  205.  
  206. {\\\\\\\\\\\\\\\\\\\\\\   Screen drawing procedures   \\\\\\\\\\\\\\\\\\\\\}
  207.  
  208. Procedure Determine_Box_Location;
  209. var Xtra : byte;
  210. begin
  211.     If D.DateTime then
  212.        Xtra := 1
  213.     else
  214.        Xtra := 0;
  215.     If D.DateTime and (D.cols < 4) then D.cols := 4;
  216.     If (D.cols < 1) or (D.cols > 6)  then D.cols := 6;
  217.     If (D.Rows < 1) or (D.Rows + xtra > 23) then D.Rows := 23 - xtra;
  218.     If (D.TopX < 1) or (D.TopX > (79 - D.cols*13)) then
  219.     If D.cols =  6 then D.TopX := 1 else
  220.        D.TopX := 40  - ( (D.cols*13) + 2 ) div 2;
  221.     If D.TopX < 1 then D.TopX := 1;
  222.     If (D.TopY < 1) or (D.TopY > (24 - D.Rows - Xtra)) then
  223.     If D.Rows - Xtra = 23 then D.TopY := 1 else
  224.        D.TopY := ( 23 - D.Rows - xtra) div 2;
  225.     If D.TopY < 1 then D.TopY := 1;
  226. end; {Proc Determine_Box_Location}
  227.  
  228. Procedure Draw_Box;
  229. var
  230.   Y2,Xtra: byte;
  231. begin
  232.     If D.DateTime then
  233.        Xtra := 1
  234.     else
  235.        Xtra := 0;
  236.     X2 := D.TopX + 2 + 13*D.cols;
  237.     Y2 := D.TopY + 1 + D.Rows + Xtra;
  238.     FBox(D.TopX,D.TopY,X2,Y2,D.boxcol,D.Baccol,1);
  239. end; {Proc Draw_Box}
  240.  
  241. Procedure LoDisplayFileName(Entry :byte; DPage : DirectoryData);
  242. var C,R,X1,Y1,Color : byte;
  243. begin
  244.     C := CalcCol(Entry);
  245.     R := CalcRow(Entry);
  246.     X1 := D.TopX + 1 + (13 * pred(C));
  247.     If D.DateTime then
  248.        Y1 := D.TopY + R +1
  249.     else
  250.        Y1 := D.TopY + R;
  251.     If Subdirectory(Dpage.FileData[C,R]^.attr) then
  252.        Color := D.Dircol
  253.     else
  254.        Color := D.NorCol;
  255.     Fastwrite(X1,Y1,attr(Color,D.BacCol),
  256.              ' '+left(Dpage.FileData[C,R]^.name,13,' '));
  257. end; {LoDisplayFileName}
  258.  
  259. Procedure HiDisplayFileName(Entry :byte; DPage : DirectoryData);
  260. var C,R,X1,Y1,color : byte;
  261.     text : string;
  262. begin
  263.     C := CalcCol(Entry);
  264.     R := CalcRow(Entry);
  265.     X1 := D.TopX + 1 + (13 * pred(C));
  266.     If D.DateTime then
  267.        Y1 := D.TopY + R +1
  268.     else
  269.        Y1 := D.TopY + R;
  270.     If Subdirectory(DPage.Filedata[C,R]^.attr) then
  271.        color := D.DirCol
  272.     else
  273.        color := D.HiFCol;
  274.     If DPage.TotFiles > 0 then
  275.     begin
  276.         Text := #16 + Dpage.FileData[C,R]^.name  ;  {place arrows at each end}
  277.         Text := Left(Text,13,' ') + #17;
  278.         Fastwrite(X1,Y1,attr(Color,D.HiBCol),text);
  279.         If D.DateTime then
  280.            If SubDirectory(DPage.FileData[C,R]^.attr) then
  281.            begin
  282.                If Dpage.FileData[C,R]^.name = '..' then
  283.                   Text := 'Directory '+ ExtractPrevDir(Pathname)
  284.                else
  285.                   Text := 'Directory '+ Pathname + Dpage.FileData[C,R]^.name;
  286.            Text := Center(Text,X2-D.TopX-2,' ');
  287.            Fastwrite(D.TopX+1,D.TopY+1,attr(Color,D.BacCol),Text);
  288.        end
  289.        else   {must be a file}
  290.        begin
  291.            Text := Dpage.Filedata[C,R]^.Name+'  '+
  292.                    FileDetails(DPage.FileData[C,R]^);
  293.            Text := Center(Text,X2-D.TopX-2,' ');
  294.            Fastwrite(D.TopX+1,D.TopY+1,attr(Color,D.BacCol),Text);
  295.        end;
  296.     end
  297.     else    {no files}
  298.     begin
  299.         Text := Center('No File(s)',X2-D.TopX-2,' ');
  300.         Fastwrite(D.TopX+1,D.TopY+1,attr(Color,D.BacCol),Text);
  301.     end;
  302. end; {HiDisplayFileName}
  303.  
  304. Procedure DisplayDirPage(var DPage : DirectoryData);
  305. var I : integer;
  306. begin
  307.     For I := 1 to Dpage.Totfiles do
  308.         LoDisplayFileName(I,Dpage);
  309.     If (Dpage.TotFiles > 1) and (length(PathName) > 3) and D.Cdir then
  310.        DPage.CurrEntry := 2
  311.     else
  312.        DPage.CurrEntry := 1;
  313.     HiDisplayFileName(DPage.CurrEntry,DPage);
  314. end; {DisplayDirPage}
  315.  
  316. {\\\\\\\\\\\\\\\\\\\\\\  Array filling  procedures   \\\\\\\\\\\\\\\\\\\\\\}
  317.  
  318. procedure ReadDirPage(var DPage : DirectoryData; NewPage : byte);
  319. const
  320. ReadMessage = 'Reading Directory...';
  321.  
  322. var
  323.   Y1,Counter : byte;
  324.   Msg : string;
  325.   I,J : integer;
  326.  
  327.      Procedure ReadNextDirPage(var DPage : DirectoryData);
  328.      Const
  329.          CurrFile : SearchRec= (Fill:(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  330.                                 Attr:0;Time:0;Size:0;Name:'');
  331.      Var
  332.        FirstFileRead : boolean;
  333.      begin
  334.          FirstFileRead := False;
  335.          with DPage do
  336.          begin
  337.              TotFiles := 0;
  338.              repeat
  339.                   with FileData[CalcCol(Succ(TotFiles)),
  340.                                 CalcRow(Succ(TotFiles))]^ do
  341.                   begin
  342.                       if (CurrPage = 1) and (TotFiles = 0)
  343.                       and not FirstFileRead              then
  344.                       begin
  345.                           FindFirst(PathName + FileMask,D.Attrib,CurrFile);
  346.                           FirstFileRead := True;
  347.                       end;
  348.                       Name := CurrFile.Name;
  349.                       Attr := CurrFile.Attr;
  350.                       Size := CurrFile.Size;
  351.                       Time := CurrFile.Time;
  352.                       FindNext(CurrFile);
  353.                       if  (Name <> '.') then
  354.                          TotFiles := Succ(TotFiles);
  355.                   end; { with }
  356.              until (TotFiles = (D.Rows * D.cols)) or (DOSError = 18);
  357.              MoreFiles := (DOSError <> 18);
  358.          end; { with }
  359.      end; { ReadNextDirPage }
  360.  
  361.  
  362. begin { ReadDirPage }
  363.     Draw_Box;
  364.     Fastwrite(D.TopX+1,D.TopY,attr(D.DirCol,D.BacCol),ReadMessage);
  365.     with DPage do
  366.     begin
  367.         For I := 1 to Mcols do
  368.             for J := 1 to MRows do
  369.                 FillChar(FileData[I,J]^, SizeOf(FileData[I,J]^), 0);
  370.         if NewPage < CurrPage then
  371.         begin
  372.             CurrPage := 1;
  373.             for Counter := 1 to Pred(NewPage) do
  374.             begin
  375.                 ReadNextDirPage(DPage);
  376.                 CurrPage := Succ(CurrPage);
  377.             end;
  378.         end;
  379.         CurrPage := NewPage;
  380.         ReadNextDirPage(DPage);                   { Read current directory page }
  381.         Fastwrite(D.TopX+1,D.TopY,attr(D.BoxCol,D.BacCol),
  382.                   left('',length(ReadMessage),#205));
  383.         If (length(Pathname) + 1 + length(FileMask)) < X2 - D.TopX then
  384.            Fastwrite(D.TopX+1,D.TopY,attr(D.BoxCol,D.BacCol),
  385.                      ' Directory '+Pathname+Filemask+' ')
  386.         else
  387.            Fastwrite(D.TopX+1,D.TopY,attr(D.BoxCol,D.BacCol),' '+Filemask+' ');
  388.         DisplayDirPage(DPage);
  389.         {now add the messages}
  390.         Msg := ' Esc-quit';
  391.         If ToTFiles > 0 then
  392.            Msg := Msg + '  '+#17+#217+' to select ';
  393.         If CurrPage > 1 then
  394.            Msg := Msg + '  PgUp ';
  395.         If MoreFiles then
  396.            Msg := Msg + '  PgDn ';
  397.         Y1 := D.TopY + D.Rows + 1;
  398.         If D.DateTime then Y1 := succ(Y1);
  399.         If length(Msg) <  X2 - D.TopX then
  400.            Fastwrite(D.TopX+1,Y1,attr(D.BoxCol,D.BacCol),Msg);
  401.     end; { with }
  402. end; { ReadDirPage }
  403.  
  404.  
  405. {\\\\\\\\\\\\\\\\\\\\\\  Cursor Movement Procs   \\\\\\\\\\\\\\\\\\\\\\}
  406. Function SelectFile(var Dpage : DirectoryData):string;
  407. var ChS : char;
  408.  
  409.          Procedure ProcessUp;
  410.          var Choice : integer;
  411.          begin
  412.              With Dpage do
  413.              begin
  414.                  LoDisplayFilename(CurrEntry,Dpage);
  415.                  If CurrEntry <= D.cols then {Top Row}
  416.                  begin
  417.                      If CurrEntry = 1 then
  418.                         Choice := D.cols * D.Rows
  419.                      else
  420.                         Choice := (pred(D.Rows) * D.cols) + Pred(CurrEntry);
  421.                      While Choice > TotFiles do
  422.                            Choice := Choice - D.cols;
  423.                      If Choice = 0 then Choice := TotFiles;
  424.                  end
  425.                  else
  426.                    Choice := Currentry - D.cols;
  427.                  CurrEntry := Choice;
  428.                  HiDisplayFilename(CurrEntry,Dpage);
  429.              end;  {with}
  430.          end;  {ProcessUp}
  431.  
  432.          Procedure MouseUp;
  433.          begin
  434.              With Dpage do
  435.              begin
  436.                  If CurrEntry > D.cols then {below Top Row}
  437.                  begin
  438.                      LoDisplayFilename(CurrEntry,Dpage);
  439.                      CurrEntry :=  Currentry - D.cols;
  440.                      HiDisplayFilename(CurrEntry,Dpage);
  441.                  end;
  442.              end;  {with}
  443.          end;
  444.  
  445.          Procedure ProcessDown;
  446.          var Choice : integer;
  447.          begin
  448.              With Dpage do
  449.              begin
  450.                  LoDisplayFilename(CurrEntry,Dpage);
  451.                  If CurrEntry + D.cols > TotFiles then {bottom row}
  452.                  begin
  453.                      If (CurrEntry MOD D.cols) = 0 then
  454.                         Choice := 1
  455.                      else
  456.                         Choice := (Pred(CurrEntry) MOD D.cols) + 2;
  457.                      If Choice > TotFiles then
  458.                         Choice := 1;
  459.                  end
  460.                  else
  461.                     Choice := CurrEntry + D.cols;
  462.                  CurrEntry := Choice;
  463.                  HiDisplayFileName(CurrEntry,Dpage);
  464.              end; {With}
  465.          end; {ProcessDown}
  466.  
  467.          Procedure MouseDown;
  468.          begin
  469.              With Dpage do
  470.              begin
  471.                  If CurrEntry + D.cols <= TotFiles then {not bottom row}
  472.                  begin
  473.                      LoDisplayFilename(CurrEntry,Dpage);
  474.                      CurrEntry := CurrEntry + D.cols;
  475.                      HiDisplayFileName(CurrEntry,Dpage);
  476.                  end;
  477.              end; {With}
  478.          end;
  479.  
  480.          Procedure ProcessLeft;
  481.          begin
  482.              With Dpage do
  483.              begin
  484.                  LoDisplayFilename(CurrEntry,Dpage);
  485.                  If CurrEntry = 1 then
  486.                     CurrEntry := TotFiles
  487.                  else
  488.                     CurrEntry := Pred(CurrEntry);
  489.                  HiDisplayFileName(CurrEntry,Dpage);
  490.              end; {with}
  491.          end; {ProcessLeft}
  492.  
  493.          Procedure MouseLeft;
  494.          begin
  495.              With Dpage do
  496.              begin
  497.                  If CurrEntry Mod D.cols <> 1 then
  498.                  begin
  499.                      LoDisplayFilename(CurrEntry,Dpage);
  500.                      CurrEntry := Pred(CurrEntry);
  501.                      HiDisplayFileName(CurrEntry,Dpage);
  502.                  end;
  503.              end; {with}
  504.          end; {ProcessLeft}
  505.  
  506.          Procedure ProcessRight;
  507.          begin
  508.              With Dpage do
  509.              begin
  510.                  LoDisplayFilename(CurrEntry,Dpage);
  511.                  If CurrEntry = TotFiles then
  512.                     CurrEntry := 1
  513.                  else
  514.                     CurrEntry := Succ(CurrEntry);
  515.                  HiDisplayFileName(CurrEntry,Dpage);
  516.              end; {with}
  517.          end; {ProcessRight}
  518.  
  519.          Procedure MouseRight;
  520.          begin
  521.              With Dpage do
  522.              begin
  523.                  If (CurrEntry Mod D.cols <> 0) and (CurrEntry < TotFiles) then
  524.                  begin
  525.                      LoDisplayFilename(CurrEntry,Dpage);
  526.                      CurrEntry := Succ(CurrEntry);
  527.                      HiDisplayFileName(CurrEntry,Dpage);
  528.                  end;
  529.              end; {with}
  530.          end; {ProcessLeft}
  531.  
  532.          Function ProcessCR: string;
  533.          begin
  534.              With Dpage do
  535.              begin
  536.                  With FileData[CalcCol(CurrEntry),CalcRow(CurrEntry)]^ do
  537.                  begin
  538.                      If Subdirectory(Attr) then
  539.                      begin
  540.                          ChDir(Name);
  541.                          GetDir(0,PathName);
  542.                          If Pathname[Length(PathName)] <> '\' then
  543.                          PathName := PathName + '\';
  544.                          FileMask := '*.*';
  545.                          Draw_Box;
  546.                          ReadDirPage(Dpage,1);
  547.                          ChS := ' ';
  548.                          ProcessCr := '';
  549.                      end
  550.                      else {Not a sub-directory}
  551.                         ProcessCr := Name;          {Could include path if desired}
  552.                  end; {With}
  553.              end; {with}
  554.          end; {ProcessCR}
  555.  
  556. begin
  557.     With Dpage do
  558.     begin
  559.         Repeat
  560.              ChS := Getkey;
  561.              If TotFiles > 0 then
  562.              begin
  563.                  Case upcase(Chs) of
  564.                  CursUp   : ProcessUp;
  565.                  #128     : MouseUp;
  566.                  CursDown : ProcessDown;
  567.                  #129     : MouseDown;
  568.                  CursLeft : ProcessLeft;
  569.                  #130     : MouseLeft;
  570.                  CursRight: ProcessRight;
  571.                  #131     : MouseRight;
  572.                  PgUp     : If CurrPage > 1 then
  573.                                 ReadDirPage(Dpage,Pred(CurrPage));
  574.                  PgDn     : If MoreFiles then
  575.                                ReadDirPage(Dpage, Succ(CurrPage));
  576.                  #133,
  577.                  Enter    : SelectFile := ProcessCr;
  578.                  #132,
  579.                  Esc      : If D.AllowEsc then
  580.                                SelectFile := Esc;
  581.                  end;  {case}
  582.              end
  583.              else
  584.                 SelectFile := Esc;
  585.         Until (ChS in [Enter,#133])
  586.            or ((ChS in [Esc,#132]) and D.AllowEsc);
  587.     end;  {with Dpage}
  588. end;  {SelectFile}
  589.  
  590.  
  591. begin   {Main function Display_Directory}
  592.     If ValidPathname  and (MemAvail >= SizeOf(DBox.FileData[1,1]^)*Mcols*Mrows) then
  593.     begin
  594.         For I := 1 to Mcols do
  595.             for J := 1 to MRows do
  596.                 GetMem(DBox.FileData[I,J],sizeof(DBox.FileData[I,J]^));
  597.         Determine_Box_Location;
  598.         Draw_Box;
  599.         Dbox.CurrPage := 1;
  600.         ReadDirPage(Dbox,1);
  601.         Display_Directory := SelectFile(Dbox);
  602.         For I := 1 to Mcols do
  603.             for J := 1 to MRows do
  604.                 FreeMem(DBox.FileData[I,J],sizeof(DBox.FileData[I,J]^));
  605.     end
  606.     else
  607.         Display_Directory := '';
  608. end;
  609.  
  610. begin   {auto execute proc}
  611.    Default_Settings;
  612.    Horiz_Sensitivity := 3;
  613. end.